L = [x*x for x in range(10)]
print("len: ",len(L))
print(L)

L = [x*x for x in range(10) if x %2!=0] # 筛选出奇数
print("len: ",len(L))
print(L)

# 全排列
L = [m+n for n in 'abc' for m in 'xyz']
print(L)

L = [m+n for n in "abc" for m in "xyz"]
print(L)

dict1 = {'a':'x','b':'y'}

L = [k + '=' + v for k,v in dict1.items()] #使用列表生成式遍历多个变量
print(L)

# 初始化一个100个元素的全为0的数组
L = [0 for _ in range(100)]
print("len: ",len(L))
print(L)


